#ifndef SERVER_H
#define SERVER_H

#include <QThread>
#include <QTcpServer>
#include <QTcpSocket>
#include <QList>

class Server : public QThread
{
Q_OBJECT

public:
	Server(QString newName, int newPort);
	~Server();

	void run();

private slots:
	void handleNewConnection();
	void receiveMessage();

private:
	QString name;
	int port;
	QTcpServer *sock;
	QList<QTcpSocket*> connections;
};

#endif // SERVER_H
